package com.qingxin.park.entity;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.hibernate.annotations.GenericGenerator;


/**
 * 园区表
 */
@Entity
@Table(name = "farm_park")
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class FarmPark extends com.qingxin.sys.entity.BaseEntity implements
		java.io.Serializable {
	private static final long serialVersionUID = 8828720653550889355L;
	// Fields

	private String parkid;
	private String parkNo;
	private String parkName;
	private String parkAddress;
	private String logoUrl;
	private String contactPerson;
	private String phone;
	private String mobile;
	private String email;
	private String wechat;
	private BigDecimal lat;
	private BigDecimal lng;
	private String remark;
	private String describ;
	private Integer parkLevel;
	private String parkStatus;//1正常2停用
	private String teseStatus;//0 不是特色园区  1特色园区
	private String isdel;//0正常1删除
	private String regionid;
	private String groupid;
	private String companyid;
	private String createBy;
	private Date createTime;
	private String updateBy;
	private Date updateTime;
	private Set<Material> materials = new HashSet<>(0);
	private Set<SysUserParkRel> sysUserParkRels = new HashSet<>(0);
	private Set<ParkBlock> parkBlocks = new HashSet<>(0);
	private Set<ParkNotify> parkNotifies = new HashSet<>(0);

	// Constructors

	/** default constructor */
	public FarmPark() {
	}
	
	
	public FarmPark(String parkid) {
		this.parkid = parkid;
	}


	public FarmPark(String parkid, String parkName) {
		this.parkid = parkid;
		this.parkName = parkName;
	}
	public FarmPark(String parkid, String parkName, String companyid) {
		this.parkid = parkid;
		this.parkName = parkName;
		this.companyid = companyid;
	}
	

	public FarmPark(String parkid, String parkName, String parkAddress,
			BigDecimal lat, BigDecimal lng) {
		this.parkid = parkid;
		this.parkName = parkName;
		this.parkAddress = parkAddress;
		this.lat = lat;
		this.lng = lng;
	}

	

	public FarmPark(String parkid, String parkNo, String parkName,
			String logoUrl, String remark, Integer parkLevel, Date createTime) {
		this.parkid = parkid;
		this.parkNo = parkNo;
		this.parkName = parkName;
		this.logoUrl = logoUrl;
		this.remark = remark;
		this.parkLevel = parkLevel;
		this.createTime = createTime;
	}


	public FarmPark(String parkid, String parkNo, String parkName,
			String contactPerson, String mobile,
			Integer parkLevel, String parkStatus,String teseStatus) {
		this.parkid = parkid;
		this.parkNo = parkNo;
		this.parkName = parkName;
		this.contactPerson = contactPerson;
		this.mobile = mobile;
		this.parkLevel = parkLevel;
		this.parkStatus = parkStatus;
		this.teseStatus = teseStatus;
	}


	/** full constructor */
	public FarmPark(String parkNo, String parkName, String parkAddress,
			String logoUrl, String contactPerson, String phone, String mobile,
			String email, String wechat, BigDecimal lat, BigDecimal lng, String remark,
			String describ, Integer parkLevel, String parkStatus, String isdel,
			String regionid, String groupid, String companyid, String createBy, Date createTime,
			String updateBy, Date updateTime, Set<Material> materials,
			Set<SysUserParkRel> sysUserParkRels, Set<ParkBlock> parkBlocks, Set<ParkNotify> parkNotifies) {
		this.parkNo = parkNo;
		this.parkName = parkName;
		this.parkAddress = parkAddress;
		this.logoUrl = logoUrl;
		this.contactPerson = contactPerson;
		this.phone = phone;
		this.mobile = mobile;
		this.email = email;
		this.wechat = wechat;
		this.lat = lat;
		this.lng = lng;
		this.remark = remark;
		this.describ = describ;
		this.parkLevel = parkLevel;
		this.parkStatus = parkStatus;
		this.isdel = isdel;
		this.regionid = regionid;
		this.groupid = groupid;
		this.companyid = companyid;
		this.createBy = createBy;
		this.createTime = createTime;
		this.updateBy = updateBy;
		this.updateTime = updateTime;
		this.materials = materials;
		this.sysUserParkRels = sysUserParkRels;
		this.parkBlocks = parkBlocks;
		this.parkNotifies = parkNotifies;
	}
	
	

	public FarmPark(String parkNo, String parkName, String parkAddress,
			String logoUrl, String contactPerson, String phone, String mobile,
			String email, String wechat, BigDecimal lat, BigDecimal lng,
			String remark, String describ, Integer parkLevel,
			String parkStatus, String teseStatus, String isdel,
			String regionid, String groupid, String companyid, String createBy,
			Date createTime, String updateBy, Date updateTime,
			Set<Material> materials, Set<SysUserParkRel> sysUserParkRels,
			Set<ParkBlock> parkBlocks, Set<ParkNotify> parkNotifies) {
		this.parkNo = parkNo;
		this.parkName = parkName;
		this.parkAddress = parkAddress;
		this.logoUrl = logoUrl;
		this.contactPerson = contactPerson;
		this.phone = phone;
		this.mobile = mobile;
		this.email = email;
		this.wechat = wechat;
		this.lat = lat;
		this.lng = lng;
		this.remark = remark;
		this.describ = describ;
		this.parkLevel = parkLevel;
		this.parkStatus = parkStatus;
		this.teseStatus = teseStatus;
		this.isdel = isdel;
		this.regionid = regionid;
		this.groupid = groupid;
		this.companyid = companyid;
		this.createBy = createBy;
		this.createTime = createTime;
		this.updateBy = updateBy;
		this.updateTime = updateTime;
		this.materials = materials;
		this.sysUserParkRels = sysUserParkRels;
		this.parkBlocks = parkBlocks;
		this.parkNotifies = parkNotifies;
	}


	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "parkid", unique = true, nullable = false, length = 32)
	public String getParkid() {
		return this.parkid;
	}

	public void setParkid(String parkid) {
		this.parkid = parkid;
	}

	@Column(name = "park_no", length = 20)
	public String getParkNo() {
		return this.parkNo;
	}

	public void setParkNo(String parkNo) {
		this.parkNo = parkNo;
	}

	@Column(name = "park_name", length = 100)
	public String getParkName() {
		return this.parkName;
	}

	public void setParkName(String parkName) {
		this.parkName = parkName;
	}

	@Column(name = "park_address", length = 200)
	public String getParkAddress() {
		return this.parkAddress;
	}

	public void setParkAddress(String parkAddress) {
		this.parkAddress = parkAddress;
	}

	@Column(name = "logo_url", length = 100)
	public String getLogoUrl() {
		return this.logoUrl;
	}

	public void setLogoUrl(String logoUrl) {
		this.logoUrl = logoUrl;
	}

	@Column(name = "contact_person", length = 20)
	public String getContactPerson() {
		return this.contactPerson;
	}

	public void setContactPerson(String contactPerson) {
		this.contactPerson = contactPerson;
	}

	@Column(name = "phone", length = 20)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "mobile", length = 20)
	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name = "email", length = 50)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	
	
	@Column(name = "wechat", length = 50)
	public String getWechat() {
		return wechat;
	}
	public void setWechat(String wechat) {
		this.wechat = wechat;
	}


	@Column(name = "lat", precision = 15, scale = 10)
	public BigDecimal getLat() {
		return this.lat;
	}

	public void setLat(BigDecimal lat) {
		this.lat = lat;
	}

	@Column(name = "lng", precision = 15, scale = 10)
	public BigDecimal getLng() {
		return this.lng;
	}

	public void setLng(BigDecimal lng) {
		this.lng = lng;
	}

	@Column(name = "remark", length = 1000)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "describ")
	public String getDescrib() {
		return this.describ;
	}

	public void setDescrib(String describ) {
		this.describ = describ;
	}

	@Column(name = "park_level")
	public Integer getParkLevel() {
		return this.parkLevel;
	}

	public void setParkLevel(Integer parkLevel) {
		this.parkLevel = parkLevel;
	}

	@Column(name = "park_status", length = 1)
	public String getParkStatus() {
		return this.parkStatus;
	}

	public void setParkStatus(String parkStatus) {
		this.parkStatus = parkStatus;
	}
	
	@Column(name = "tese_status", length = 1)
	public String getTeseStatus() {
		return teseStatus;
	}

	public void setTeseStatus(String teseStatus) {
		this.teseStatus = teseStatus;
	}


	@Column(name = "isdel", length = 1)
	public String getIsdel() {
		return isdel;
	}
	public void setIsdel(String isdel) {
		this.isdel = isdel;
	}

	@Column(name = "regionid", length = 50)
	public String getRegionid() {
		return this.regionid;
	}

	public void setRegionid(String regionid) {
		this.regionid = regionid;
	}

	@Column(name = "groupid", length = 50)
	public String getGroupid() {
		return groupid;
	}

	public void setGroupid(String groupid) {
		this.groupid = groupid;
	}

	@Column(name = "companyid", length = 32)
	public String getCompanyid() {
		return companyid;
	}

	public void setCompanyid(String companyid) {
		this.companyid = companyid;
	}

	@Column(name = "create_by", length = 32)
	public String getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	@Column(name = "create_time", length = 23)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "update_by", length = 32)
	public String getUpdateBy() {
		return this.updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

	@Column(name = "update_time", length = 23)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "farmPark")
	@JsonIgnore
	public Set<Material> getMaterials() {
		return this.materials;
	}

	public void setMaterials(Set<Material> materials) {
		this.materials = materials;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "farmPark")
	@JsonIgnore
	public Set<SysUserParkRel> getSysUserParkRels() {
		return this.sysUserParkRels;
	}

	public void setSysUserParkRels(Set<SysUserParkRel> sysUserParkRels) {
		this.sysUserParkRels = sysUserParkRels;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "farmPark")
	@JsonIgnore
	public Set<ParkBlock> getParkBlocks() {
		return this.parkBlocks;
	}

	public void setParkBlocks(Set<ParkBlock> parkBlocks) {
		this.parkBlocks = parkBlocks;
	}
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "farmPark")
	@JsonIgnore
	public Set<ParkNotify> getParkNotifies() {
		return this.parkNotifies;
	}

	public void setParkNotifies(Set<ParkNotify> parkNotifies) {
		this.parkNotifies = parkNotifies;
	}
	

}